package com.feicheng.common.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class WxServiceInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    WxServiceInterceptor wxServiceInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(wxServiceInterceptor).addPathPatterns("/wx/app/**")
                .excludePathPatterns(
                        "/wx/app/store/info",
                        "/wx/app/client/login/wx-code",
                        "/wx/app/client/card-record/notice-url/**",
                        "/wx/app/client/deposit-record/notice-url/**",
                        "/wx/app/order/notice-url/**",
                        "/wx/app/client/deposit-back-request/notice-url/**"
                );
    }

}
